package besta.moon.engine;

import java.sql.*;

import besta.moon.MoonConnection;
import besta.moon.engine.store.MoonNoCurrentRow;
import besta.moon.sql.datatype.MutableNumeric;
import besta.moon.engine.store.MoonNull;

public abstract class Moon {

    public static final Moon NULL = new MoonNull();
    public static final Moon NOROW = new MoonNoCurrentRow();

    public abstract boolean isNull(int offset) throws Exception;

    public abstract boolean getBoolean(int offset, int dataType)
            throws Exception;

    public abstract byte[] getBytes(int offset, int dataType) throws Exception;

    public abstract double getDouble(int offset, int dataType) throws Exception;

    public abstract float getFloat(int offset, int dataType) throws Exception;

    public abstract int getInt(int offset, int dataType) throws Exception;

    public abstract long getLong(int offset, int dataType) throws Exception;

    public abstract long getMoney(int offset, int dataType) throws Exception;

    public abstract MutableNumeric getNumeric(int offset, int dataType)
            throws Exception;

    public abstract Object getObject(int offset, int dataType) throws Exception;

    public abstract String getString(int offset, int dataType) throws Exception;

    public boolean isValidPage() {
        return false;
    }

    public abstract void scanObjectOffsets(int[] offsets, int dataTypes[]);

    public abstract int getUsedSize();

    public abstract long getNextPagePos();

    public abstract void deleteRow(MoonConnection con) throws SQLException;
}
